<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="../../../css/common.css" media="all">
	</head>
	<body>
		<div class="layui-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12">
					<div class="layui-card">
						<div class="layui-card-body">
							<!-- 搜索 -->
							<!-- <form class="layui-form search" id="form" onsubmit="return false" action="##">
								<div class="layui-inline search_inline">
									<label class="layui-form-label">产品类型：</label>
									<div class="layui-input-inline">
										<select name="type" class="product"></select>
									</div>
								</div>
								<button class="layui-btn search_inline" lay-submit="" lay-filter="search" data-type="reload">搜索</button>
								<button class="layui-btn layui-btn-primary search_inline" type="reset">重置</button>
							</form> -->
							<!-- 搜索 -->
								
							<table class="layui-hide" id="test-table-operate" lay-filter="test-table-operate"></table>
								
							<script type="text/html" id="test-table-operate-barDemo">
								<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</a>
							</script>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<script type="text/html" id="demo_ul">
			{{#  layui.each(d.data, function(index, item){ }}
				<li class=" {{ index == 0 ? 'layui-this' : '' }}" lay-id='{{ item.id }}'>{{ item.name }}</li>
			{{# }); }}
		</script>
		
		<script src="../../../layuiadmin/layui/layui.js"></script>
		<script src="../../../js/common.js" type="text/javascript" charset="utf-8"></script>
		<script>
			layui.config({
				base: '../../../layuiadmin/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index', 'form', 'laytpl', 'laydate','table','element'], function() {
				var $ = layui.$,
					admin = layui.admin,
					laytpl = layui.laytpl,
					element = layui.element,
					laydate = layui.laydate,
					table = layui.table,
					form = layui.form;
				
				var _data = {};
				
				initdata();
				
				function initdata() {
					table.render({
						elem: '#test-table-operate',
						url: server.querycash_out,
						height: 'full-80',
						cols: [
							[{
								width: 120,
								align: 'center',
								toolbar: '#test-table-operate-barDemo',
								title: '操作',
								fixed: 'left'
							}, {
								field: 'name',
								title: '名称'
							}, {
								field: 'fee',
								title: '手续费'
							}, {
								field: 'low',
								title: '最低提现金额'
							}, {
								field: 'tax',
								title: '税点'
							}]
						],
						page: true,
						limit: 20,
						where: _data,
						request: {
							pageName: 'page',
							limitName: 'size',
						},
						parseData: function(res) { //将原始数据解析成 table 组件所规定的数据
							return {
								"code": res.code, //解析接口状态
								"msg": res.msg, //解析提示文本
								"count": res.cash_out.pager.total, //解析数据长度
								"data": res.cash_out.data //解析数据列表
							};
						}
					});
				}
				
				//监听工具条
				table.on('tool(test-table-operate)', function(obj) {
					var data = obj.data;
					if (obj.event === 'del') {
						layer.confirm('真的删除行么', function(index) {
							obj.del();
							layer.close(index);
						});
					} else if (obj.event === 'edit') {
						layer.open({
							type: 2,
							title: '编辑',
							shadeClose: false,
							scrollbar: false,
							shade: 0.5,
							area: ['50%', '50%'],
							content: '../model/cash_out.html?id=' + data.id,
						});
					}
				});
				function initdatadetail(id) {
					$.get(server.querycash_outdetail, {id: id}, function(res, status) {
						if (status == 'success') {
							if (res.code == 0) {
								var data = res.site_config
								
								form.val("test_detail", data.data);
								form.render();
							} else {
								layer.msg(res.msg);
							}
						} else {
							layer.msg('服务器连接错误');
						}
					});
				}
			});
		</script>
	</body>
</html>
